package com.spa.infrastructure.enums.dict.base;

import com.spa.infrastructure.annotation.SysDictEnumAnnotation;
import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
@SysDictEnumAnnotation(key = "fileUploadTypeEnum", desc = "文件上传类型")
public enum FileUploadTypeEnum {

    $MASSAGIST_10("MASSAGIST_10", "massagist/life_photo/",1,0,"技师生活照"),
    $MASSAGIST_20("MASSAGIST_20", "massagist/work_photo/",2,0,"技师工作照"),
    $MASSAGIST_30("MASSAGIST_30", "massagist/identity_card/",3,0,"技师身份证"),
    $MASSAGIST_40("MASSAGIST_40", "massagist/qualification_certificate/",4,0,"技师资格证"),
    $MASSAGIST_50("MASSAGIST_50", "massagist/health_certificate/",5,0,"技师健康证"),

    ;

    private String code;
    private String desc;
    //排序
    private Integer sort;
    //状态  0 启用  1 不启用
    private Integer status;
    private String remark;


    public static FileUploadTypeEnum byCode(String code) {
        for (FileUploadTypeEnum value : values()) {
            if (value.code.equals(code)) return value;
        }
        return null;
    }

    public static boolean contain(String url) {
        for (FileUploadTypeEnum value : values()) {
            if (url.contains(value.desc)) return true;
        }
        return false;
    }

}
